home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / DEV / I-Z / TransSkel.cpt / common.pas next >
Pascal/Delphi Source File  |  1987-01-08  |  1KB  |  64 lines

  1. {    Common Unit.  Contains several routines which are used by several of}
  2. {the othe units.  }
  3. {Written 7 January 1987 Owen Hartnett, Ωhm Software Co.}
  4.  
  5. UNIT common;
  6.  
  7. INTERFACE
  8.  
  9.     USES
  10.         multiSkelGlobs;
  11.  
  12.  
  13.     PROCEDURE DrawGrowBox (wind : WindowPtr);
  14.     PROCEDURE SetWindClip (wind : WindowPtr);
  15.     PROCEDURE ResetWindClip;
  16.  
  17. IMPLEMENTATION
  18.  
  19.     VAR
  20.         oldClip : RgnHandle;
  21.  
  22. {    Miscellaneous routines}
  23. {    These take care of drawing the grow box and the line along}
  24. {    the right edge of the window, and of setting and resetting the clip}
  25. {    region to disallow drawing in that right edge by the other drawing}
  26. {    routines.}
  27.  
  28.     PROCEDURE DrawGrowBox;
  29.  
  30.         VAR
  31.             r : Rect;
  32.             oldClip : RgnHandle;
  33.  
  34.     BEGIN
  35.         r := wind^.portRect;
  36.         r.left := r.right - 15;        { draw only along right edge }
  37.         oldClip := NewRgn;
  38.         GetClip(oldClip);
  39.         ClipRect(r);
  40.         DrawGrowIcon(wind);
  41.         SetClip(oldClip);
  42.         DisposeRgn(oldClip);
  43.     END;
  44.  
  45.     PROCEDURE SetWindClip;
  46.  
  47.         VAR
  48.             r : Rect;
  49.  
  50.     BEGIN
  51.         r := wind^.portRect;
  52.         r.right := r.right - 15;        { don't draw along right edge }
  53.         oldClip := NewRgn;
  54.         GetClip(oldClip);
  55.         ClipRect(r);
  56.     END;
  57.  
  58.     PROCEDURE ResetWindClip;
  59.  
  60.     BEGIN
  61.         SetClip(oldClip);
  62.         DisposeRgn(oldClip);
  63.     END;
  64. END.